package cn.iocoder.an.module.mold.dal.mysql.recheckcategory;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.mold.dal.dataobject.recheckcategory.RecheckCategoryDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.mold.controller.admin.recheckcategory.vo.*;

/**
 * 复检类型 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface RecheckCategoryMapper extends BaseMapperX<RecheckCategoryDO> {

    default PageResult<RecheckCategoryDO> selectPage(RecheckCategoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RecheckCategoryDO>()
                .eqIfPresent(RecheckCategoryDO::getStatus, reqVO.getStatus())
                .likeIfPresent(RecheckCategoryDO::getCode, reqVO.getCode())
                .likeIfPresent(RecheckCategoryDO::getName, reqVO.getName())
                .eqIfPresent(RecheckCategoryDO::getRecheckPeriod, reqVO.getRecheckPeriod())
                .betweenIfPresent(RecheckCategoryDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RecheckCategoryDO::getId));
    }

}